package com.tanklab.signature.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="用户对象", description="用户个人信息表")
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户唯一注册序号")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long user_id;

    @ApiModelProperty(value = "用户名")
    private String user_name;

    @ApiModelProperty(value = "密码(暂不使用)")
    private String user_pswd;

    @ApiModelProperty(value = "用户登陆token(暂不使用)")
    private String token;

    @ApiModelProperty(value = "用户权限，0为学生，1为老师")
    @TableField(value = "authority")
    private int authority;

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    @ApiModelProperty(value = "openid")
    private String openid;

    @ApiModelProperty(value = "unionid")
    private String unionid;

    @TableField(value = "session_key", insertStrategy = FieldStrategy.NOT_NULL)
    @ApiModelProperty(value = "session_key")
    private String sessionKey;  // 需加密存储

    @TableField(value = "create_time")
    @ApiModelProperty(value = "用户创建时间")
    private Date createTime;

    @TableField(value = "last_login_time")
    @ApiModelProperty(value = "用户上次登录时间")
    private Date lastLoginTime;

    @TableField(value = "avatar_url")
    @ApiModelProperty(value = "用户头像url")
    private String avatarUrl;

    @TableField(value = "signature_url")
    @ApiModelProperty(value = "用户签名图片url")
    private String signatureUrl;

    @TableField(value = "signature_hash")
    @ApiModelProperty(value = "签名图片哈希值")
    private String signatureHash;

    @TableField(value = "signature_tx_id")
    @ApiModelProperty(value = "签名图片交易ID")
    private String signatureTxId;
}